home *** CD-ROM | disk | FTP | other *** search
- //
- // TESTICON.CPP
- // version 1.00 11/15/91
- // uses Icon Class in ICON.CPP
- // copyright (c) 1991 by James S. Clark
- // all rights reserved
- //
-
- #include <graphics.h>
-
- #include <stdlib.h> // random
- #include <conio.h> // getch()
-
- #include "icon.hpp"
-
-
- // setup graphics mode
-
- void initgraphics(void)
- {
- int graphdriver = EGA;
- int graphmode = EGALO;
-
- initgraph(&graphdriver, &graphmode, "C:\\");
- if (graphresult()) exit(1);
- }
-
-
- main(void)
- {
- Icon *icon;
- int i;
-
- initgraphics();
-
- icon = new Icon(64, 32, 16); // create icon handler
- icon->read(32, "MAP.IMG"); // read 128 icons from MAP
-
- for (i=0; i<16; i++) // draw the first 16
- icon->put(i, i, 1);
-
- getch();
-
- delete icon; // deallocate memory
- closegraph();
- return 0;
- }
-
-
-